package org.aphelie.torg.ruler.internal.core;

import org.aphelie.torg.ruler.core.IModel;
import org.aphelie.torg.ruler.core.IModelProviderEvent;


public class ModelProviderEvent implements IModelProviderEvent {
    private int types;
    private Object source;
    private IModel[] added;
    private IModel[] removed;
    private IModel[] changed;

    public ModelProviderEvent(Object source, int types, IModel[] added, IModel[] removed, IModel[] changed) {
        this.source = source;
        this.types = types;
        this.added = added;
        this.removed = removed;
        this.changed = changed;
    }

    public IModel[] getAddedModels() {
        return (added == null) ? new IModel[0] : added;
    }

    public IModel[] getRemovedModels() {
        return (removed == null) ? new IModel[0] : removed;
    }

    public IModel[] getChangedModels() {
        return (changed == null) ? new IModel[0] : changed;
    }

    public int getEventTypes() {
        return types;
    }

    public Object getEventSource() {
        return source;
    }
}
